﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;

using FinalProject.UI.Controls;
using System.Windows;

namespace FinalProject.UI
{
    public class Utilities
    {
        public static void SwichToEditMode(UserControl control, bool isEdited)
        {
            if (control == null) return;
            if (control.Parent is TabItem)
            {
                HTabItem parent = control.Parent as HTabItem;
                if (parent != null)
                {
                    parent.InEditMode = isEdited;
                }
            }
        }

        public static MessageBoxResult GetMessageWarning(string text)
        {
            return MessageBox.Show(text, "Warning", MessageBoxButton.YesNo, MessageBoxImage.Warning);
        }

        public static MessageBoxResult GetMessageInfo(string text)
        {
            return MessageBox.Show(text, "Information", MessageBoxButton.OK, MessageBoxImage.Information);
        }

        public static MessageBoxResult GetMessageError(string text)
        {
            return MessageBox.Show(text, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
        }
    }
}
